<?php get_header(); ?>
<?php global $woo_options; ?>

		<?php get_sidebar('left'); ?>
		
		<div id="main">

			<div class="content-wrapper">
				<div class="content">
				
				    <?php /*query_posts('order='.$woo_options['woo_post_order'].'&showpost=1');*/ if (have_posts()) : $count = 0; ?>
        			<?php while (have_posts() && $count == 0) : the_post(); $count++; ?>
        			
        			<?php $GLOBALS['selected'] = get_the_title($post->ID); ?>
				
					<div class="content-inner post">
						
						<p class="chapter-info"><span class="chapter-number"><?php _e('Chapter','woothemes'); ?> </span> <span class="chapter-caption"><?php $caption = get_post_meta($post->ID, "caption", $single = true); if ($caption) { echo '&ldquo;' . get_post_meta($post->ID, "caption", $single = true) . '&rdquo;'; } ?></span></p>
						
						<h2 class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
						
						<?php woo_post_meta(); ?>
						
						<?php woo_image('width='.$woo_options['woo_thumb_w'].'&height='.$woo_options['woo_thumb_h'].'&class=thumbnail '.$woo_options['woo_thumb_align']); ?> 
						
						<div class="entry">
							<?php the_content(); ?>
						</div>
						
						<?php $comm = $woo_options['woo_comments']; if ( ($comm == "post" || $comm == "both") ) : ?>
							
							<?php if (is_home()){ ?>
							<?php
							$permalink_string = get_permalink();
							$pos = strpos($permalink_string,'?');
							if($pos === false) {
								// string needle NOT found in haystack
								$char_param = '?';
							} else {
								// string needle found in haystack
								$char_param = '&';
							}
							$modified_permalink = $permalink_string.$char_param.'h=t#comments-wrap';
							?>
							<!-- <p class="comments"><span><a href="<?php echo $modified_permalink; ?>"><?php comments_number(__('0 Comments', 'woothemes'), __('1 Comments', 'woothemes'), __('% Comments', 'woothemes')); ?></a> &darr;</span></p> -->
							
							<?php } else { ?>
							
						<!--	<p class="comments"><span><?php comments_number(__('0 Comments', 'woothemes'), __('1 Comments', 'woothemes'), __('% Comments', 'woothemes')); ?> &darr;</span></p>-->
							
							<?php } ?>
							
						<?php endif; ?>
						
					</div><!-- /.post -->
					
					<?php endwhile; endif; ?>
					
				</div>
			</div>
			
			<?php $comm = $woo_options['woo_comments']; if ( ($comm == "post" || $comm == "both") ) : ?>
				<div id="comments-wrap" <?php if(($_GET['h']) == 't') { ?> class="from-home" <?php }?>>
	        		<?php comments_template(); ?>
	        	</div><!-- /#comments-wrap -->
        	<?php endif; ?>
			
		</div><!-- /#main -->
		
		<?php get_sidebar('right'); ?>
		
<?php get_footer(); ?>